<?php 
session_start();
include 'config.php';




    $email = $_GET['error'];


	if(isset($_POST['submit'])){
    	    
    	    
			
    	    
    	    	    
							    $password = $_POST['edit_pass'];
							   
							  
							    
				 $password_sql="UPDATE usertable set password ='$password' where email='$email'";
							    $password_query = mysqli_query($con, $password_sql);
							    
							    	header("location:login.php?error=reset");
							    
							  
							}
							
							
							
		
			

?>



<?php include "form_nav.php"?>

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<body class="auth-body">
  <!-- header starts -->
  <div class="auth-header">
   

    <img class="img-fluid img" src="assets/images/authentication/1.svg" alt="v1" />

    <div class="auth-content">
      <div>
        <h2>Reset Password !!</h2>
        <h4 class="p-0">Enter New Password</h4>
      </div>
    </div>
  </div>
  <!-- header end -->

<style>

   .form-group {
      position: relative;
      margin-bottom: 20px;
    }

    input[type="text"],
    input[type="password"] {
      width: 100%;
      padding: 10px 40px 10px 10px;
      box-sizing: border-box;
      border: 1px solid #ccc;
      border-radius: 4px;
    }

    .toggle-password {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      cursor: pointer;
      font-size: 18px;
      color: #888;
    }

</style>


  <!-- login section start -->
  <form class="auth-form" method="POST" action="">
    <div class="custom-container">
     <div class="form-group">
         <label for="inputusername" class="form-label">Email:</label>
        <input type="text" readonly name="email" value="<?php echo $email?>" required>
      </div>
      <div class="form-group">
          <label for="inputusername" class="form-label">New Password:</label>
        <input type="password" id="password" name="edit_pass" placeholder="New Password" required>
        <i class="fa-solid fa-eye toggle-password" onclick="togglePassword()" id="toggleIcon" style="margin-top:15px"></i>
      </div>
     

      <button type="submit" name="submit" class="btn theme-btn w-100">Reset Password</button>
    

    
    </div>
  </form>
  <!-- login section start -->




 <script>
    function togglePassword() {
      const passwordInput = document.getElementById("password");
      const toggleIcon = document.getElementById("toggleIcon");

      if (passwordInput.type === "password") {
        passwordInput.type = "text";
        toggleIcon.classList.remove("fa-eye");
        toggleIcon.classList.add("fa-eye-slash");
      } else {
        passwordInput.type = "password";
        toggleIcon.classList.remove("fa-eye-slash");
        toggleIcon.classList.add("fa-eye");
      }
    }
  </script>







  <!-- feather js -->
  <script src="assets/js/feather.min.js"></script>
  <script src="assets/js/custom-feather.js"></script>

  <!-- bootstrap js -->
  <script src="assets/js/bootstrap.bundle.min.js"></script>

  <!-- script js -->
  <script src="assets/js/script.js"></script>
</body>


<!-- Mirrored from themes.pixelstrap.net/pwa/mpay/signin.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 05 Apr 2024 02:03:41 GMT -->
</html>



	<?php 
					
					
					if(!isset($_GET['error'])){
						
						exit();
						
					}
					else{
						$errorcheck = $_GET['error'];
						
						if($errorcheck == "wronginfo") {
							
							?>
							
							
							<script >
		
		alert("The Email And Password Combination You Entered Is Incorrect");
		</script>
							
							
							<?php
							
						}
						
						
					}
					
					
					
					
					
					?>
	